import random

def sort(list):
    hi=len(list)
    print(list)
    while hi >1:
        isEnd=True
        for i in range(0,hi-1):
            if list[i+1]<list[i]:
                tmp=list[i]
                list[i]=list[i+1]
                list[i+1]=tmp
                isEnd=False
        if isEnd:
            
            print('直接跳过')
            break
        hi=hi-1
        print(list)
    return list
        


if __name__ == "__main__":
    # testArray=[]
    # while len(testArray)<20:
    #     testArray.append(random.randint(0,100))
    # print("最终结果==",sort(testArray))
    testArray2= [1, 23, 24, 91, 99, 37, 41, 47, 47, 54, 55, 57, 58, 61, 67, 69, 71, 77, 78, 91]
    print("最终结果==",sort(testArray2))